<?php

namespace App\Http\Controllers;

/**
 * Class IndexController 首页显示
 *
 * @package App\Http\Controllers
 */
class IndexController extends Controller
{
    public function index()
    {
        return redirect()->away('https://mylovegy.github.io/blog');
    }

    public function jsonAction()
    {
        $name = request()->get('name', 'child');
        return $this->success([
            'ip'               => get_ip(),
            'time'             => date('Y-m-d H:i:s'),
            'application_name' => 'Laravel Admin',
            'plural'           => str_plural($name),
            'name'             => str_plural($name, 1),
            'request_name'     => $name,
        ]);
    }
}